package com.leyou.order.inter.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @数表名称 tb_order
 * @开发日期 2020-03-05
 */
@Data
@Table(name="tb_order")
public class Order implements Serializable {
    
    /** 订单id (主健ID) */
    @Id
    @Column(name="order_id")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long orderId;

    /** 总金额，单位为分 */
    @Column(name="total_pay")
    private Long totalPay;

    /** 实付金额。单位:分。如:20007，表示:200元7分 */
    @Column(name="actual_pay")
    private Long actualPay;

    /** 参与促销活动的id */
    @Column(name="promotion_ids")
    private String promotionIds;

    /** 支付类型，1、在线支付，2、货到付款 */
    @Column(name="payment_type")
    private Integer paymentType;

    /** 邮费。单位:分。如:20007，表示:200元7分 */
    @Column(name="post_fee")
    private Long postFee;

    /** 订单创建时间 */
    @Column(name="create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;

    /** 物流名称 */
    @Column(name="shipping_name")
    private String shippingName;

    /** 物流单号 */
    @Column(name="shipping_code")
    private String shippingCode;

    /** 用户id */
    @Column(name="user_id")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long userId;

    /** 买家留言 */
    @Column(name="buyer_message")
    private String buyerMessage;

    /** 买家昵称 */
    @Column(name="buyer_nick")
    private String buyerNick;

    /** 买家是否已经评价,0未评价，1已评价 */
    @Column(name="buyer_rate")
    private Boolean buyerRate;

    /** 收获地址（省） */
    @Column(name="receiver_state")
    private String receiverState;

    /** 收获地址（市） */
    @Column(name="receiver_city")
    private String receiverCity;

    /** 收获地址（区/县） */
    @Column(name="receiver_district")
    private String receiverDistrict;

    /** 收获地址（街道、住址等详细地址） */
    @Column(name="receiver_address")
    private String receiverAddress;

    /** 收货人手机 */
    @Column(name="receiver_mobile")
    private String receiverMobile;

    /** 收货人邮编 */
    @Column(name="receiver_zip")
    private String receiverZip;

    /** 收货人 */
    @Column(name="receiver")
    private String receiver;

    /** 发票类型(0无发票1普通发票，2电子发票，3增值税发票)  (默认值为: 0) */
    @Column(name="invoice_type")
    private Integer invoiceType;

    /** 订单来源：1:app端，2：pc端，3：M端，4：微信端，5：手机qq端  (默认值为: 2) */
    @Column(name="source_type")
    private Integer sourceType;

    @Transient
    private List<OrderDetail> orderDetails;

    @Transient
    private Integer status;

    @Transient
    private OrderStatus orderStatus;

    @Transient
    private String phone;

    @Transient
    private String username;

    @Transient
    private String name;

    private static final long serialVersionUID = 1L;
}